package com.itxialu.reggie.common;


/**
 * 基于ThreadLocal封装工具类，用户保存和获取当前登录用户id
 *
 * @author shkstart
 * @create 2022-10-02 18:22
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(long id) {
        threadLocal.set(id);
    }

    public static long getCurrentId() {
        return threadLocal.get();
    }
}
